package cn.scxy.bookcity.controller;

import cn.scxy.bookcity.pojo.vo.PmsCategoryListVO;
import cn.scxy.bookcity.service.IPmsCategoryService;
import cn.scxy.bookcity.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gzh
 * @version 1.0.0
 * @date 2022/11/28 21:24
 */
@RestController
@Slf4j
@Api(tags = "类别管理")
@RequestMapping("/pmsCategory")
public class PmsCategoryController {
    @Autowired
    IPmsCategoryService pmsCategoryService;

    @GetMapping("/allName")
    @ApiOperationSupport(order =401)
    @ApiOperation("查询类别名称")
    public JsonResult<List<PmsCategoryListVO>> allName() {
        List<PmsCategoryListVO> allName = pmsCategoryService.allName();
        return JsonResult.ok(allName);
    }
}
